package com.chap14;

/**
 * <p>
 * <code>Singleton</code>
 * </p>
 *
 * @author junbao3
 * TODO
 * @date 2023-04-17 8:39
 * Copyright (C) 2021 IFlyTek. All rights reserved.
 */
public class Singleton {
    private static Singleton singleton;

    public Singleton() {
    }

    public static Singleton getSingleton() {
        if (singleton == null){
            synchronized (Singleton.class){
                if (singleton==null){
                    singleton = new Singleton();
                }
            }
        }
        return singleton;
    }
}
